package com.yitiao.data_algorithms.leetcode.editor.cn;

import java.util.Arrays;
import java.util.HashMap;

class SortThePeople{
    // 2023-04-25 17:07:16
    public static void main(String[] args) {
        Solution solution = new SortThePeople().new Solution();
    }
    
    //leetcode submit region begin(Prohibit modification and deletion)
class Solution {
    public String[] sortPeople(String[] names, int[] heights) {
        HashMap<Integer, String> map = new HashMap<>();
        for (int i = 0; i < heights.length; i++) {
            map.put(heights[i],names[i]);
        }
        Arrays.sort(heights);
        System.out.println(heights[0]);
        for (int i = 0; i < heights.length; i++) {
            names[names.length-i-1] = map.get(heights[i]);
        }
        return names;
    }
}
//leetcode submit region end(Prohibit modification and deletion)

}